The following list shows reserved words in Python. These reserved words cannot be used as constants or variables, or any other identifier name.
All Python keywords contain only lowercase letters
== |
If the values of two operands are equal, then the condition becomes true |
a == b is not true |
!= |
If values of two operands are not equal, then condition becomes true |
a != b is true |
<> |
If values of two operands are not equal, then condition becomes true |
a <> b is true. This is similar to != operator |
> |
If the value of left operand is greater than the value of right operand, then condition become true |
a > b is not true |
< |
If the value of left operand is less than the value of right operand, then condition becomes true |
a>b is true |
>= |
If the value of left operand is greater than or equal tot he value of right operand, then condition becomes true |
a >= b is not true |
If the value of left operand is less than or equal to the value of right operand, then condition becomes true |
a < = b is true |
|
Operator |
Description |
Example |
= |
Assigns values from right side operands to left side perand |
c = a + b, a + b into c |
+= Add and |
It adds right operand to the left operand and assign the result to left operand |
c += a, c = c + a |
-= Subtract and |
It subtracts right operand from the left operand and assign the result to left operand |
c -= a, c = c-a |
*= Multiply and |
It multiplies right operand with the left operand and assign the result to left operand |
c *= a, c = c * a |
/= Divide and |
It divides left operand with the right operand and assign the result to left operand |
c /= a, c = c / a |
%= Modulus and |
t takes modulus using two operands and assign the result to left operand |
c %= a, c = c % a |
**= Exponent and |
Performs exponential (power) calculation on operators and assign value to the left operand |
c **= a, c = c ** a |
//= Floor division |
It performs floor division on operators and assign value to the left operand |
c //= a, c = c //a |